﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Marmat.Template.WinForm
{
    public partial class BaseViewForm<Entity> : Form, IDocumentViewForm<Entity>
    {
        public BaseViewForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 数据源
        /// </summary>
        protected Entity[] DataSource { get; private set; }

        /// <summary>
        /// 用户控制器
        /// </summary>
        public IDocumentViewFormController<Entity, Entity[]> Controller { get; set; }

        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="data"></param>
        public virtual new void Load(Entity[] data)
        {
            this.DataSource = data;
        }
    }
}
